/**
 * 新增-行情分析js
 */
var editor = UE.getEditor('editor', {
         imageScaleEnabled :false,
         enableAutoSave :false,   
         initialFrameWidth : 590,
         initialFrameHeight : 420,
         wordCount : false,
         elementPathEnabled :false,
         autoHeightEnabled : false
     });
  	
    editor.ready(function() { 
    	editor.setContent(''); 
		});

	  editor.addListener("contentchange", function() {
	        $("#introdution").html(editor.getContent());
	        vm.contentStr = $("#introdution").html(editor.getContent()).html();
	    });
  
    
    editor.addListener('afterExecCommand',function(t, e, arg){
    	afterUploadImage(e);
    	});
    	//2、单张图片上传返回的e为inserthtml，多张图片上传返回的e为insertimage，执行插入段落命令。
    	function afterUploadImage() {
    	if(arguments[0]=="inserthtml" || arguments[0]=="insertimage"){
    		editor.execCommand( 'insertparagraph' );
    	}
    }
var vm = new Vue({
	el:'#dpLTE',
	data: {
		contentStr:"",
		quotationAnalysis: {
			status: 1
		}
	},
	methods : {
		acceptClick: function() {
			if (!$('#form').Validform()) {
		        return false;
		    }
		    $.SaveForm({
		    	url: '../../sys/quotationanalysis/save?contentStr='+vm.contentStr+'&_' + $.now(),
		    	param: vm.quotationAnalysis,
		    	success: function(data) {
		    		$.currentIframe().vm.load();
		    	}
		    });
		}
	}
})
